package com.dongxing.concyrrency.chapter2;

/**
 * @author XavierDong
 **/
public class TaxCalculatorMain {

    public static void main(String[] args) {
/*        TaxCalculator taxCalculator = new TaxCalculator(10000d, 2000d){
            @Override
            protected Double calcTax() {
                return getSalary()*0.1+getBonus()*0.15;
            }
        };
        Double aDouble = taxCalculator.calcuate();
        System.out.println(aDouble);*/

        TaxCalculator taxCalculator = new TaxCalculator(10000d, 2000d, TaxCalculatorMain::execute);
        System.out.println(taxCalculator.calcuate());

    }

    public static Double execute(final Double salary, final Double bonus) {
        return salary * 0.1 + bonus * 0.15;
    }
}
